import React, { Component } from 'react'
import PropTypes from "prop-types"
import './index.css'
import Item from "../Item"
export default class index extends Component {
    static propTypes = {
        todos: PropTypes.array.isRequired,
        updateTodo: PropTypes.func.isRequired,
        remove: PropTypes.func.isRequired
    }
    render() {
        const {todos,updateTodo,remove} = this.props;
        return (
            <ul className="todo-main">
                {
                    todos.map((v,index) => {
                            return <Item val={v.name} {...v} key={v.id} remove={remove} updateTodo={updateTodo}/>
                    })
                }
            </ul>

        )
    }
}

